import React from 'react';

class Loading extends React.Component {
  render() {
    if (this.props.loading) {
      return (
        <div className="spinner">
          <div className="bounce1" />
          <div className="bounce2" />
          <div className="bounce3" />
        </div>
      );
    } else {
      return this.props.children;
    }
  }
}

export default Loading;
